import { Game } from "phaser";
import Test from "./scenes/Test";
import TestNode from "./scenes/TestNode";
import QGamePlugin from "./QGamePlugin";

const config = {
    type: Phaser.AUTO,
    parent: "phaser-container",
    backgroundColor: "#222222",
    antialias: true,
    scale: {
        mode: Phaser.Scale.FIT,
        autoCenter: Phaser.Scale.CENTER_BOTH,
        parent: "phaser-container",
        resolution: window.devicePixelRatio || 1,
    },
    physics: {
        default: "matter",
        matter: {
            gravity: { y: 0, x: 0 },
            enableSleep: false,
            debug: false,
        },
    },
    input: {
        activePointers: 2, // 启用多点触摸支持
    },
    scene: [Test],
    plugins: {
        scene: [
            {
                key: "QGamePlugin",
                plugin: QGamePlugin,
                mapping: "qGame",
            },
        ],
    },
};

new Game(config);

// const config2 = {
//     type: Phaser.AUTO,
//     parent: "phaser-container",
//     backgroundColor: "#222222",
//     antialias: true,
//     scale: {
//         mode: Phaser.Scale.FIT,
//         autoCenter: Phaser.Scale.CENTER_BOTH,
//         parent: "phaser-container2",
//         resolution: window.devicePixelRatio || 1,
//     },
//     physics: {
//         default: "matter",
//         matter: {
//             gravity: { y: 0, x: 0 },
//             enableSleep: false,
//             debug: false,
//         },
//     },
//     input: {
//         activePointers: 2, // 启用多点触摸支持
//     },
//     scene: [TestNode],
//     plugins: {
//         scene: [
//             {
//                 key: "QGamePlugin",
//                 plugin: QGamePlugin,
//                 mapping: "qGame",
//             },
//         ],
//     },
// };

// new Game(config2);
